﻿@model Prime.Models.Field

<script type="text/javascript">
    function HomeFieldCtrl($scope, $http) {
        var uri = "/api/Field/@ViewBag.FieldId";
        $http.get(uri).success(function (data) {
            $scope.data = data;
        }).error(function (header, status, data, config) {
            window.alert("Greska u konekciji sa serverom");
        });
    }
</script>



<div class="container" ng-controller="HomeFieldCtrl">
    <div class="row">

        <div class="col-md-4" ng-repeat="course in data.Courses">
            <div class="thumbnail panel">
                <img class="img-responsive" src='{{course.Picture}}' alt="...">
                <div class="caption panel-body">
                    <h3>{{course.CouseName}}</h3>
                    <p> {{course.Description}} </p>
                    <p><a href="/Home/Course/{{course.CourseId}}" class="btn btn-primary" role="button">Vidi lekcije</a> <a href="#" class="btn disabled" role="button">x999/{{course.NumberOfLessons}}</a></p>
                </div>
            </div>
        </div>
    </div>
</div>
